package cn.lili.modules.promotion.serviceimpl;

import cn.lili.modules.promotion.entity.dos.BlindboxCountInfo;
import cn.lili.modules.promotion.mapper.BlindboxCountInfoMapper;
import cn.lili.modules.promotion.service.BlindboxCountInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 盲盒统计详情 业务实现
 *
 * @author xiangqian
 */
@Service
@RequiredArgsConstructor
public class BlindboxCountInfoServiceImpl extends ServiceImpl<BlindboxCountInfoMapper, BlindboxCountInfo> implements BlindboxCountInfoService {

    /**
     * 新增盲盒统计详情
     *
     * @param userId  用户ID
     * @param countId 统计ID
     * @param orderId 订单ID
     * @param buyNum  订单数量
     */
    @Override
    public void addBlindboxCountInfo(String userId, String countId, String orderId, Integer buyNum) {
        BlindboxCountInfo blindboxCountInfo = new BlindboxCountInfo();
        blindboxCountInfo.setUserId(userId);
        blindboxCountInfo.setCountId(countId);
        blindboxCountInfo.setOrderId(orderId);
        blindboxCountInfo.setBuyNum(buyNum);
        this.baseMapper.insert(blindboxCountInfo);
    }
}